# 导包
import time

from selenium import webdriver
from selenium.webdriver.common.by import By

# 打开浏览器
chrome = webdriver.Chrome()
# 窗口最大化
chrome.maximize_window()
# 输入测试页面网址
chrome.get("http://121.43.169.97:8081/common/member/reg")

# 测试步骤
# 1、输入手机号码
element = chrome.find_element(By.CSS_SELECTOR, "#phone")
element.send_keys("18734494841")
# 2、输入密码
chrome.find_element(By.CSS_SELECTOR, "#password").send_keys("www.13133")

# 3、输入图片验证码
chrome.find_element(By.CSS_SELECTOR, "#verifycode").send_keys("8888")

# 4、点击获取短信验证码
chrome.find_element(By.CSS_SELECTOR, "#get_phone_code").click()
time.sleep(2)
# 5、输入短信验证码内容
chrome.find_element(By.CSS_SELECTOR, "#phone_code").send_keys("666666")
# 6、勾选协议
# 7、点击免费注册按钮
chrome.find_element(By.CSS_SELECTOR, ".lg-btn").click()

# 关闭浏览器
time.sleep(3)
chrome.quit()
